package com.foreknow.demo5Exercise2;

import java.util.Random;

public class Computer {

    private String npc;
    private int score;

    public String getNpc() {
        return npc;
    }

    public void setNpc(String npc) {
        this.npc = npc;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public Computer() {

    }

    Random rand = new Random();
    public int liuBei() {
        int suijichuquan = rand.nextInt(3)+1;
        switch(suijichuquan) {
            case 1:
                System.out.println("刘备出拳：剪刀");
                break;
            case 2:
                System.out.println("刘备出拳：石头");
                break;
            case 3:
                System.out.println("刘备出拳：布");
                break;
        }
        return suijichuquan;
    }

    public int sunQuan() {
        int suijichuquan = rand.nextInt(3)+1;
        switch(suijichuquan) {
            case 1:
                System.out.println("孙权出拳：剪刀");
                break;
            case 2:
                System.out.println("孙权出拳：石头");
                break;
            case 3:
                System.out.println("孙权出拳：布");
                break;
        }
        return suijichuquan;
    }

    public int caoCao() {
        int suijichuquan = rand.nextInt(3)+1;
        switch(suijichuquan) {
            case 1:
                System.out.println("曹操出拳：剪刀");
                break;
            case 2:
                System.out.println("曹操出拳：石头");
                break;
            case 3:
                System.out.println("曹操出拳：布");
                break;
        }
        return suijichuquan;
    }
}
